One technology that supports messaging and queuing across a network is referred to as MQSeries and is offered by International Business Machines Corporation, Armonk, N.Y. With MQSeries, users can dramatically reduce application development time by using MQSeries API functions. Since MQSeries supports many platforms, MQSeries can be ported easily from one platform to another. In a network, two MQSeries systems communicate with each other via channels, such as MQSeries channels. An MQSeries sender channel defines a connection from one MQSeries system to another MQSeries system and transmits messages from the one system to the other system.
To facilitate transmission of messages from one system to another system, memory resident queues are used. In particular, messages are written to and retrieved from the queues. Since the messages in the queues occupy system resources, such as system work blocks, it is very likely that in a high-performance, high-throughput system, a system will run out of resources, when a queue is stalled or when a communications channel is congested or stopped. If the system does run out of resources, then the system itself will be stalled and may need to be brought down.
Based on the foregoing, a need exists for a capability that manages queues to avoid an undesirable condition. In particular, a need exists for a queue management capability that detects when messages are to be removed from a queue, thereby freeing up resources associated with the queue and enabling a system to continue to provide services to other tasks and to avoid a shutdown condition.